package com.yuyue.dronesystem.beans;

import java.util.Objects;

import com.yuyue.dronesystem.enums.BoxType;

/**
 * CargoBay
 */
public class CargoBay extends Box {

    // 货仓介绍
    private String note;

    public CargoBay() {
    }

    public CargoBay(String note) {
        this.note = note;
    }

    public CargoBay(Double length, Double width, Double height, String note) {
        super(length, width, height,BoxType.CARGOBAY);
        this.note = note;
    }

    public String getNote() {
        return this.note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public CargoBay note(String note) {
        this.note = note;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this)
            return true;
        if (!(o instanceof CargoBay)) {
            return false;
        }
        CargoBay cargoBay = (CargoBay) o;
        return super.equals((Box) o) && Objects.equals(note, cargoBay.note);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), note);
    }

    @Override
    public String toString() {
        return "{" +
            " box='" + super.toString() + "'" +
            ", note='" + getNote() + "'" +
            "}";
    }
}